//
//  HmailListDetailTableViewCell.m
//  NursingManage
//
//  Created by Zhen Huang on 17/5/11.
//  Copyright © 2017年 huangzhen. All rights reserved.
//

#import "HmailListDetailTableViewCell.h"

@implementation HmailListDetailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.contentNameLabel];
        [self.contentView addSubview:self.contentLabel];
        [self.contentView addSubview:self.smsButton];
        [self.contentView addSubview:self.phoneButton];
    }
    return self;
}
- (UILabel *)contentNameLabel
{
    if (!_contentNameLabel) {
        _contentNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 10, 100, 20)];
        _contentNameLabel.font = [UIFont systemFontOfSize:15];
    }
    return _contentNameLabel;
}
- (UILabel *)contentLabel
{
    if (!_contentLabel) {
        _contentLabel = [[UILabel alloc]initWithFrame:CGRectMake(ScreenWidth - 250, 10, 150, 20)];
        _contentLabel.font = [UIFont systemFontOfSize:15];
    }
    return _contentLabel;
}
- (UIButton *)smsButton
{
    if (!_smsButton) {
        _smsButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _smsButton.frame = CGRectMake(ScreenWidth - 70, 5, 30, 30);
        [_smsButton setImage:[UIImage imageNamed:@"sms"] forState:UIControlStateNormal];
        [_smsButton addTarget:self action:@selector(smsButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
    }
    return _smsButton;
}
- (UIButton *)phoneButton
{
    if (!_phoneButton) {
        _phoneButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _phoneButton.frame = CGRectMake(ScreenWidth - 35, 5, 30, 30);
        [_phoneButton setImage:[UIImage imageNamed:@"iphone"] forState:UIControlStateNormal];
        [_phoneButton addTarget:self action:@selector(phoneButtonAction:) forControlEvents:(UIControlEventTouchUpInside)];
        
    }
    return _phoneButton;
}
- (void)smsButtonAction:(UIButton *)sender{
    
    self.clickedSmsButtonBlcok();
}


- (void)phoneButtonAction:(UIButton *)sender{
    
    self.clickedPhoneButtonBlcok();
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
